﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

/// <summary>
/// 分数统计类
/// </summary>
public class Score:MonoBehaviour {

    public int scroe = 0;

    private PlayerControl playerControl;

    private int previousScore = 0;


    private void Awake() {
        playerControl = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerControl>();
    }

    // Update is called once per frame
    void Update() {

        GetComponent<Text>().text = "Score: " + scroe;

        if (previousScore != scroe)
        {
            playerControl.StartCoroutine(playerControl.Taunt());
        }


        previousScore = scroe;
    }
}
